<!--车辆管理页-->
<template>
    <div style="height: 100%;">

        <m-page-list
                :option="option"
                :page="page"
                :total="total"
                :table-data="tableData"
                :table-loading="tableLoading"
                v-model:value="query"
                @h-btn-click="hBtnClick"
                @col-btn-click="colBtnClick"
                @search-data="searchData"
        />

        <m-dialog-form ref="dialogRef" :data="dialogData" v-model:show="dialogShow" :option="dialogOption" @confirm="dialogConfirm" ></m-dialog-form>
    </div>

</template>

<script setup>

    import {ref,reactive,onMounted,nextTick} from 'vue'
    //组件
    import MPageList from '@/components/PageList'
    import MDialogForm from '@/components/DialogForm/DialogForm'
    //请求
    import {getVehicleData,editVehicleData,addVehicleData,delVehicleData} from '@/request/api/basicData'

    import {usePageList} from "../../composables/pageList";

    //引用类型字段参数
    import {refOpt} from "../const";

    let opts = {
        // auth_id: 'stop',
        getApi: getVehicleData,
        addApi: addVehicleData,
        editApi: editVehicleData,
        delApi: delVehicleData,
        idKey: 'vehicle_no',
    };
    let {option,page,total,tableLoading,tableData,query,dialogRef,dialogShow,dialogData,
        hBtnClick,colBtnClick,searchData,dialogOption,dialogConfirm} = usePageList(opts);

    //  查询条件参数配置
    option.conditions = [
        {label: '车牌号码',type: 'text',field_id: 'vehicle_no',col: 24},
    ];
    // 表格列显示参数配置
    option.cols = [
      {prop: 'vehicle_no', label: '车牌号码',},
      {prop: 'total_seat_count', label: '总座数',},
      {prop: 'passenger_seat_count', label: '座位数',},
      {prop: 'modify_name', label: '修改员名',},
      {prop: 'modify_time', label: '修改时间',},
      {prop: 'input_name', label: '录入员名',},
      {prop: 'input_time', label: '录入时间',},

    ];

    // 新增编辑弹窗录入项配置
    dialogOption.fieldList = [
        {field_id: 'vehicle_no',editDisabled: true, label: '车牌号码',type: 'text',col: 3},
        {field_id: 'total_seat_count', label: '总座数',type: 'number',col: 3},
        {field_id: 'passenger_seat_count', label: '座位数',type: 'number',col: 3},
    ];

</script>

